* MUST be compiled in LARGE_DATA model to allow access to global data from
* different processes and loader.
*/
#define BUFSIZE 2000
#define SOFTWARE_ERROR "Software error"
#define ERROR_STR_LEN 14
/* defined in loader too */
#define DIR_CACHE 1
#define NOAUTOREQ 2
struct ExtendedFileReq {
struct FileReq Freq;
char File[REQ_FCHARS+1];
char Dir[REQ_DSIZE+1];
char Path[REQ_DSIZE+REQ_FCHARS+2];
};
struct ExecBase *SysBase;
struct ArpBase *ArpBase;
struct ReqLib *ReqBase;
struct IntuitionBase *IntuitionBase;
PVF FuncTab[3];
/* directory cache handling variables */
struct ExtendedFileReq *LastEFR;
short Usage;
short PatchFlags;
long (*OldTextRequest)();
long (*OldAutoRequest)();
void setmem(void *mem, size_t size, long value);
long AsmOldAutoReq(struct Window *Window, struct IntuiText *Body, struct IntuiText *PText, struct IntuiText *NText, long PFlag, long NFlag, long W, long H);
long NewAutoRequest(struct Window *Window, struct IntuiText *Body, struct IntuiText *PText, struct IntuiText *NText, long PFlag, long NFlag, long W, long H);
PVF *Setup(struct ArpBase *Arp, struct ReqLib *Req, long (*OldTR)(), long (*OldAR)(), short Flags)
{
SysBase = *((struct ExecBase **)4L);
ArpBase = Arp;
ReqBase = Req;
IntuitionBase = ReqBase->IntuiLib;
OldTextRequest = OldTR;
OldAutoRequest = OldAR;
PatchFlags = Flags;
FuncTab[0] = (PVF)NewAutoRequest;
FuncTab[1] = (PVF)NewTextRequest;
FuncTab[2] = (PVF)NewFileRequest;
return FuncTab;
}
char *WideText(char *Text, char *buf)
{
if (strlen(Text) <= 3) {
Format(buf, " %s ", Text);
return buf;
}
else
return Text;
}
long NewAutoRequest(struct Window *Window, struct IntuiText *Body, struct IntuiText *PText, struct IntuiText *NText, long PFlag, long NFlag, long W, long H)